﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.Serialization;
using Imageo.bintje;
using System.Collections.Specialized;

namespace Imageo
{
    public partial class ImgZoomDlg : System.Web.UI.UserControl
    {
        #region Properties
        public Unit Width
        {
            set
            {
                pnlImageControl.Width = value;
            }
        }

        public Unit Height
        {
            set
            {
                pnlImageControl.Height = value;
            }
        }

        public string Title
        {
            set
            {
                hdfTitle.Value = value;
            }
        }

        public string SearchSimilarTrailUrl
        {
            set
            {
                lnkSimilarTrails.HRef = ResolveUrl("~/ui/TrailSearch2.aspx" + value);
                lnkSimilarTrails.Visible = !string.IsNullOrEmpty(value);
            }
        }

        public string SearchSimilarImageUrl
        {
            set
            {
                lnkSimilarImages.HRef = ResolveUrl("~/ui/TrailSearch2Img.aspx" + value);
                lnkSimilarImages.Visible = !string.IsNullOrEmpty(value);
            }
        }

        public string ImageUrl
        {
            set
            {
                imgImage.ImageUrl = value;
                if (!string.IsNullOrEmpty(value))
                {
                    imgImage2.ImageUrl = value.Replace("thumb","image");
                }
                btnZoomImage.Visible = !string.IsNullOrEmpty(value);
            }
        }

        int proUserId;
        public int ProUserId
        {
            get
            {
                return proUserId;
            }
            set
            {
                proUserId = value;
            }
        }

        public int TextSize
        {
            set
            {
                lnkSimilarTrails.Style.Add("font-size" ,value.ToString()+"px;");
                lnkSimilarImages.Style.Add("font-size", value.ToString()+"px;");
            }
        }

        public string OpenTrailUrl
        {
            set
            {
                lnkTrailUrl.HRef = "";
                if (!string.IsNullOrEmpty(value))
                    lnkTrailUrl.HRef = ResolveUrl("~/ui/TrailDetails.aspx" + value); 
            }

        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void ListView1_PagePropertiesChanged(object sender, EventArgs e)
        {
        }
    }
}